Skip to content

Trapping correction module and app - #184

Open
sophieehaight wants to merge 63 commits into
cositools:develop/emfrom
sophieehaight:trapping_correction_branch
Open

Trapping correction module and app#184
sophieehaight wants to merge 63 commits into
cositools:develop/emfrom
sophieehaight:trapping_correction_branch

Conversation

@sophieehaight

Copy link
Copy Markdown

Contains a new module for applying depth-based charge trapping correction to individual hit energies along with modules with GUI options and GUI expos. The branch also includes an app for characterizing trapping with Cs-137 data. The trapping correction module requires a csv parameter file as input:
detector_0_trapping_parameters.csv
This file can also be found in resource/dee

Comment thread src/MModuleTrappingCorrection.cxx Outdated
@fhagemann

Copy link
Copy Markdown

Can we also remove HasCalibratedTiming() == true from the trapping app and replace by something like HasFastTiming() == true && HasNearestNeighbor() == false (in an effort to completely get rid of HasCalibratedTiming)?

@cositools cositools deleted a comment from codecov-commenter Aug 17, 2026

@fhagemann fhagemann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my feedback from just looking at the code.
I will also try to compile and run both the module and the app to provide more feedback on that as well! :)

Comment thread apps/TrappingCorrectionAm241.cxx
Comment thread apps/TrappingCorrectionCs137.cxx Outdated
Comment thread apps/TrappingCorrectionCs137.cxx Outdated
Comment on lines +350 to +360
// Read in the input files and make a list of hdf5 files to calibrate
if ((InputFile.GetSubString(InputFile.Length() - 4)) == "hdf5") {
HDFNames.push_back(InputFile);
cout << "hdf names loaded correctly" << endl;
} else if ((InputFile.GetSubString(InputFile.Length() - 3)) == "txt") {
cout << "Reading input file " << InputFile << endl;
cout << "WARNING: When passing a list of files, ensure that you have chosen the correct HDF5 continuous reading mode. Use the --nocontinue option to suppress continuous file reading." << endl;
MFile F;
if (F.Open(InputFile) == false) {
cout << "Error: Failed to open input file." << endl;
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there examples for a txt input file?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The txt files give the lineshift across depth but they need to be fit to sim CCE curves in python to get the trapping param files so I'm not sure how helpful these will be until someone else needs to learn to produce trapping params. Just probably not something we need incorporated in nuclearizer atm.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I was refering to a txt file used to pass multiple filenames to the app.
Would that just be

gse_filename1.hdf5
gse_filename2.hdf5
gse_filename3.hdf5
...

?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah that's it

Comment thread apps/TrappingCorrectionCs137.cxx
Comment thread src/MModuleTrappingCorrection.cxx Outdated
Comment thread src/MModuleTrappingCorrection.cxx Outdated
Comment thread include/MModuleTrappingCorrection.h Outdated
Comment thread include/MModuleTrappingCorrection.h Outdated
Comment thread include/MModuleTrappingCorrection.h
@fhagemann

Copy link
Copy Markdown

The example file in resource/dee and the results after applying the inverse charge trapping in the DEE looks reasonable:

image image image image image

@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Comment thread src/MModuleTrappingCorrection.cxx Outdated
Comment thread src/MGUIOptionsLoaderMeasurementsHDF.cxx
@fhagemann fhagemann linked an issue Aug 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Charge Trapping correction

3 participants